package cn.edu.nit.sys.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @Author xiaobai
 * @Date 2023/3/19 23:44
 * @Version 1.0.0
 */
@Getter
public enum FlowEnum {

    ONE("0", "新建"),
    TWO("1", "班主任审批"),
    THREE("2", "学院审批"),
    FOUR("3", "学生办审批"),
    FIVE("4", "归档");


    @EnumValue
    private String code;
    @JsonValue
    private String label;

    FlowEnum(String code, String label) {
        this.code = code;
        this.label = label;
    }

    public static String getCode(FlowEnum name) {
        for(FlowEnum flowEnum : FlowEnum.values()) {
            if(flowEnum.equals(name)) {
                return flowEnum.getCode();
            }
        }
        return "-1";
    }
}
